import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home'
import HomeIndex from '../components/Home/Index'
import Problems from '../components/Home/Problems'
import ProblemInfo from '../components/Home/ProblemInfo'
import SubmitPage from '../components/Home/SubmitProblem'
import JudgePage from '../components/Home/JudgeStatus'
import Login from '../components/Home/Login'
import Help from '../components/Home/Help'
import Rank from '../components/Home/Rank'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home,
    redirect: '/index',
    children:[
      {
        path: '/index',
        name: 'index',
        component: HomeIndex
      },
      {
        path: '/problems',
        name: 'problems',
        component: Problems
      },
      {
        path: '/problem/:id',
        name: 'problemInfo',
        component: ProblemInfo
      },
      {
        path: '/submitpage/:id',
        name: 'submitpage',
        component: SubmitPage
      },
      {
        path: '/judgepage',
        name: 'judgepage',
        component: JudgePage
      },
      {
        path:'/login',
        name: 'login',
        component: Login
      },
      {
        path: '/help',
        name: 'help',
        component: Help
      },
      {
        path: '/rank',
        name: 'rank',
        component: Rank
      }
    ]
  },
]




const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
